<template>
	<view class="partner-wrapper">
		<!-- 返回首页 -->
		<uni-bankhome />
		<view class="detailBox">
			<div class="scroll-v view-wrapper">
				<view class="view-item" v-for="(logItem, logIndex) in dataListArr" :key="logIndex">
					<view class="view-item-detail">
						<view class="-title">{{logItem.remark||''}}</view>
						<view class="-title">订单号：{{logItem.sn||''}}</view>
					</view>
					<view class="view-item-change">
						<view class="-money green" v-if="
							userInfo.id===logItem.payee">
							+{{logItem.money | unitPrice}}
						</view>
						<view class="-money" v-else>
							-{{logItem.money | unitPrice}}
						</view>
						<view class="-time">{{logItem.createTime}}</view>
					</view>
				</view>
				<u-empty v-if="datas.length==0" mode="history" text="暂无记录" />
				<u-loadmore v-else bg-color='#f8f8f8' :status="status" />
			</div>
		</view>
	</view>
</template>

<script>
	import {
		getList
	} from "@/api/partnerList";
	export default {
		data() {
			return {
				userInfo: {}, //用户详情信息
				detailTitle: '',
				dataListArr: [] //收益数据详情列表
			};
		},
		/**
		 * 加载
		 */
		async onLoad(options) {
			this.userInfo = this.$options.filters.isLogin() || {}
			if (options.income == '0') {
				uni.setNavigationBarTitle({
					title: options.time + '年',
				})
				this.detailTitle = options.time + '年'
			} else if (options.income == '1') {
				uni.setNavigationBarTitle({
					title: options.time,
				})
				this.detailTitle = options.time
			} else if (options.income == '2') {
				uni.setNavigationBarTitle({
					title: options.time,
				})

				this.detailTitle = options.time
			}
			this.dataList(options.time)
		},
		methods: {
			async dataList(time) {
				let param = {
					time: time
				}
				let detailList = await getList(param)
				this.dataListArr = detailList.data.result.records
			}
		},
	};
</script>

<style lang="scss" scoped>
	.partner-wrapper {
		width: 100%;
		height: 100vh;
		background: #FFFFFF;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		overflow-x: hidden;
		background-color: #f8f8f8;

		.detailTitle {
			width: 100%;
			height: auto;
			font-size: 36rpx;
			font-weight: bold;
			letter-spacing: 4rpx;
		}

		.green {
			color: $aider-color-green !important;
		}

		.view-item {
			padding: 32rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
		}

		.view-item-change {
			text-align: right;

			>.-money {
				font-size: 36rpx;
				color: $main-color;
				font-weight: bold;
			}

			>.-time {
				font-size: 22rpx;
				color: #999;
			}
		}

		.view-item-detail {
			line-height: 1.75;

			>.-title {
				font-size: 28rpx;
			}

			>.-number {
				font-size: 22rpx;
				color: #999;
			}
		}

		.submit-btn {
			line-height: 90rpx;
			text-align: center;

			color: #fff;
			background: $main-color;

			margin: 0 auto;
			height: 90rpx;
		}

		.operation {
			font-size: 32rpx;
			margin-right: 24rpx;
			color: rgb(96, 98, 102);
		}
	}
</style>
